package com.nowadays.mobile.utils;

import android.content.Context;
import android.media.AudioManager;
import android.media.SoundPool;

import com.nowadays.mobile.MainApplication;

import java.util.HashMap;

public class CommonUtils {
  public static HashMap<Integer, Integer> mSoundMap;
  public static int mTickStreamId;
  public static SoundPool mSoundPool;

  public static float getCurrentVolume() {
    Context context = MainApplication.getContext();
    AudioManager am = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
    float currentStreamVolume = am.getStreamVolume(AudioManager.STREAM_MUSIC);
    float maxStreamVolume = am.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
    return currentStreamVolume / maxStreamVolume;
  }
}
